﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		IEmailRepository.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 //   File:            IEmailRepository.cs
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System;
using System.Collections.Generic;
using Dexter.Domain.Model;

namespace Dexter.Repository {
	
	/// <summary>
	/// 	Rapresents a repository of <see cref="EmailMessage"/>.
	/// </summary>
	public interface IEmailRepository : IRepository <EmailMessage> {
		/// <summary>
		/// 	Queues the specified email into dispatcher list.
		/// </summary>
		/// <param name = "item">The item.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Queue ( EmailMessage item );

		///<summary>
		///	Peeks a set of <c>EmailMessage</c> from the queue.
		///</summary>
		///<param name = "size">The size of return's array.</param>
		///<returns>
		///	An array of <c>EmailMessage</c>.
		///	The return object could be null if there isn't items into it.
		///</returns>
		///<exception cref="ArgumentNullException"> If <paramref name="size"/> is lesser then 1.</exception>
		IEnumerable <EmailMessage> Peek ( int size );

		/// <summary>
		/// 	The lifecycle of the item is completed, so this method removes it from the repository.
		/// </summary>
		/// <param name = "item">The item to remove.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Dequeue ( EmailMessage item );
	}
}
